<script setup lang="tsx">
import { PropType, reactive } from 'vue'
import type { BasicsParameterValue } from '@/api/parameter/types'
import { Table, TableColumn } from '@/components/Table'
import { useI18n } from '@/hooks/web/useI18n'
// import { ElTag } from 'element-plus'

const { t } = useI18n()

defineProps({
  basicsParameterValueList: {
    type: Object as PropType<BasicsParameterValue[]>,
    default: () => null
  }
})
const columns: TableColumn[] = [
  {
    field: 'description',
    label: t('parameterValue.description')
  },
  {
    field: 'parameterValue',
    label: t('parameterValue.parameterValue')
  },
  {
    field: 'parameterValueMin',
    label: t('parameterValue.parameterValueMin')
  },
  {
    field: 'parameterValueMax',
    label: t('parameterValue.parameterValueMax')
  },
  {
    field: 'sequence',
    label: t('parameterValue.sequence')
  },
  {
    field: 'priorityValue',
    label: t('parameterValue.priorityValue')
  },
  {
    field: 'isActive',
    label: t('parameterValue.isActive'),
    slots: {
      default: (data) => {
        return <span>{data.category == 0 ? '禁用' : '启用'}</span>
      }
    }
  },
  {
    field: 'createdDate',
    label: t('parameterValue.createdDate')
  }
]
</script>

<template>
  <Table :columns="columns" :data="basicsParameterValueList" />
</template>
